This is the teleport script i made when i wanted multiple destinations and/or start points, can go either way
Code:
teleport:
/// Put start coords below, if you only want 1 , only use 1
local.startarray = makeArray
( -1700.05 3069.68 200 )
( -1500.05 3069.68 200 )
( -2000.05 3069.68 200 )
endArray
// same with destinations, if you want multiple random ones, put multiple in there.
local.destinations = makeArray
( -724 4668 240 )
( 566 4537 240 )
( 587 3335 240 )
( 456 3779 324 )
endArray
while(1)
{
/// pick random destination and start
local.dest = local.destinations[((randomint local.destinations.size) + 1)][1]
local.start = local.startarray[((randomint local.startarray.size) + 1)][1]
//double checks for no NIL values
if(local.start == NIL)
local.start = local.startarray[1][1]
if(local.dest == NIL)
local.dest = local.destinations[1][1]
//////////////////////
/// Spawn new teleport ////
local.trig = spawn trigger_use origin (local.start)
local.port = spawn script_model model "emitters/welding_spark.tik" origin (local.start)
local.trig setsize ( -30 -30 0 ) ( 30 30 10 )
local.trig waittill trigger
local.player = parm.other
local.player tele local.dest
local.trig remove
local.port remove
wait 3
}
end
So if you wanted just one destination , only have one set of coords, and same with start point.
I chose to use arrays , rather then a switch clause, less to write to add more locations lol